package com.eui.demo.demonodes.model
{
	import com.eui.arch.application.event.NodeNavEvent;
	import com.eui.arch.application.model.NodePM;
	import com.eui.arch.util.GlobalEventDispatcher;
	import com.eui.arch.util.PMContext;
	
	import flash.utils.getQualifiedClassName;

	public class HomePM extends NodePM
	{
		public static const MANAGED_PM_ID:String = getQualifiedClassName(HomePM);

		public static function getInstance():HomePM
		{
			return PMContext.getInstance().getPM(MANAGED_PM_ID) as HomePM;
		}

		public function HomePM()
		{
		}

		override public function pmId():String
		{
			return MANAGED_PM_ID;
		}

		public function navToDemoWizard():void
		{
			GlobalEventDispatcher.getInstance().dispatchEvent(new NodeNavEvent("DemoWizard"));
		}

		public function navToFirstStepInDemoWizard(value:String):void
		{
			var data:Object = new Object();
			data.name = value;
			GlobalEventDispatcher.getInstance().dispatchEvent(new NodeNavEvent("DemoWizard", data));
		}

		public function navToLastStepInDemoWizard(value:String):void
		{
			// TODO Auto-generated method stub
			var data:Object = new Object();
			data.stepName = "last";
			data.name = value;
			GlobalEventDispatcher.getInstance().dispatchEvent(new NodeNavEvent("DemoWizard", data));
		}
	}
}